using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using IrrlichtNETCP;
using IrrlichtNETCP.Inheritable;

namespace Tubes {
    public partial class Form1 : Form {


        public Form1() {
            InitializeComponent();
            // start an irrlicht thread
            //System.Threading.ThreadStart irrThreadStart = new System.Threading.ThreadStart(startIrr);
            //irrThread = new System.Threading.Thread(irrThreadStart);
            //irrThread.Start();

        }

        private void Form1_Shown(object sender, EventArgs e) {

            this.irrControl1.RenderedScene = new csMake3DModelScene();
            irrControl1.Driver_Type = DriverType.Direct3D9;
            timer1.Start();
            this.irrControl1.Run();
        }        

        private void timer1_Tick(object sender, EventArgs e) {
            this.Text = irrControl1.getFPS().ToString();
        }

        private void Form1_Load(object sender, EventArgs e) {

        }

        protected override void OnClosing(CancelEventArgs e) {
            irrControl1.Stop();
            base.OnClosing(e);
        }
    }
}